package com.zhijian.medical.controller;


import com.zhijian.medical.api.CommonResult;
import com.zhijian.medical.entity.po.ExperimentFishSampleReady;
import com.zhijian.medical.service.FishSampleReadyService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 * 前端控制器
 * </p>
 *
 * @author li xiao dong
 * @since 2022-08-12
 */
@Slf4j
@RestController
@Api(tags = "【FISH实验】样本处理区")
@RequestMapping("/fish")
public class FishSampleReadyController {

    @Autowired
    private FishSampleReadyService sampleReadyService;

    @PostMapping("/experiment/sample")
    @ApiOperation("创建样本处理区")
    public CommonResult<Boolean> create(@RequestBody ExperimentFishSampleReady experimentFishSampleReady) {
        return CommonResult.success(sampleReadyService.create(experimentFishSampleReady));
    }

    @GetMapping("/experiment/sample/{fishId}")
    @ApiOperation("根据实验id查询样本处理区详情")
    public CommonResult<ExperimentFishSampleReady> detail(@PathVariable("fishId") Long fishId) {
        return CommonResult.success(sampleReadyService.detail(fishId));
    }

}

